<script>
	
	function Login()
	{
		var credencials=new Object();
		credencials.module="Core.Login";
		credencials.email=$("email").getValue();
		credencials.password=$("password").getValue();
		
		new Ajax.Request('Model.php', {
			method: 'post',
			parameters: credencials,
			onSuccess: function(transport){
				var JSONtext = transport.responseText;
				var JSONobject = JSON.parse(JSONtext);
				if(JSONobject['result']==1)
					location="index.php";
				else
					$("warning").update(JSONobject['error']);
			},
			onFailure: function(){
				$("warning").update("Could not connect to server");
			}
		})

	} 

   
   

</script>
<div id="Login">
	<div class="top_box"><span></span></div>
          <div class="centercontent_box">
			<table>
				
				<tr><td>Email:</td><td><input type="text" id="email"></td></tr>
				<tr><td>Password:</td><td><input type="password" id="password"></td></tr>
				<tr><td colspan="2" align="center"><input type="button" onClick="Login()" value="Login"></td></tr>
				<tr><td colspan="2" align="center"> <div id="warning"></div></td></tr>
					
			</table>
		</div>
     <div class="bottom_box"><span></span></div>
 

</div>